<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>vue显示过滤结果方法</title>
		<script src="https://cdn.jsdelivr.net/npm/vue"></script>
	</head>
	<body>
		<ul id="app">
			<li v-for="item in event()">{{item}}</li>
		</ul>
		<script>
			var vm = new Vue({
				el:'#app',
				data:{
					numbers:[1,2,3,4,5]
				},
				methods:{
					event:function(){
						return this.numbers.filter(function(number){
							return number%2===0;
						})
					}
				}
			})
		</script>
	</body>
</html>
